#pragma once

namespace LSH
{

class File
{
public:
    File();
    File(String& fileName);
    ~File();
public:
    bool    open(String& fileName);
    void    close();
    int     length()    const;
    int     position()  const;
    bool    endOfFile() const;
public:
    bool    seekSet(int offset = 0);
    bool    seekCur(int offset);
    bool    seekEnd(int offset = 0);
public:
    char    parseChar()     const;
    short   parseShort()    const;
    int     parseInt()      const;
    float   parseFloat()    const;
    double  parseDouble()   const;

    unsigned int    read(void *buffer, int size, int count = 1) const;
    unsigned int    readString(char *stringBuffer) const;
    unsigned char   readByte()  const;
    unsigned short  readWord() const;
    unsigned int    readDWord() const;

    char    readChar()      const;
    float   readFloat()     const;
    double  readDouble()    const;

    

protected:
    FILE*   _pFileHandle;

    String  _fileFullPath;
};

}   // LSH
